package com.fkcai.hansoul.common.util;

import lombok.Getter;
import lombok.ToString;

/**
 * 自定义系统状态码
 */

@Getter
@ToString
public enum ResultCode {
	/**
	 * 基础状态码 20000 - 29999
	 */
	// 基础状态码
	SUCCESS(20000, "成功"),
	ERROR(20001, "失败"),
	
	SENSITIVE_WORD(20250, "包含敏感词"),
	
	/**
	 * 业务状态码 60000 - 69999
	 */
	// 用户模块 60000 - 61000
	USER_REGISTER_ERROR(60000, "用户注册失败"),
	USER_LOGIN_ERROR(60001, "用户登录失败"),
	USER_FORGET_PASSWORD_ERROR(60002, "密码找回失败"),
	USER_UPDATE_PASSWORD_ERROR(60003, "密码更新失败"),
	USER_NOT_EXIST(60004, "用户不存在"),
	USER_NOT_LOGIN(60005, "用户未登录"),
	USER_NOT_AUTHORIZED(60006, "用户未授权"),
	USER_SENSITIVE_WORD(60007, "用户名包含敏感词"),
	USER_AVATAR_UPLOAD_FAILED(60008, "头像上传失败"),
	USER_COVER_UPLOAD_FAILED(60009, "封面上传失败"),
	USER_UPDATE_USERNAME_ERROR(60010, "用户更新用户名失败"),
	USER_UPDATE_GENDER_ERROR(60011, "用户更新性别失败"),
	USER_UPDATE_BIRTHDAY_ERROR(60012, "用户更新生日失败"),
	USER_UPDATE_LOCATION_ERROR(60013, "用户更新位置失败"),
	USER_UPDATE_BIO_ERROR(60014, "用户更新简介失败"),
	USERNAME_TOO_LONG(60015, "用户名长度过长"),
	USERNAME_TOO_SHORT(60016, "用户名长度过短"),
	USERNAME_DUPLICATED(60017, "用户名重复"),
	USERNAME_EXIST(60018, "用户名已存在"),
	PHONE_NOT_EXIST(60019, "手机号不存在"),
	USER_PHONE_DUPLICATED(60020, "用户手机号重复"),
	USER_PHONE_REGISTERED(60021, "手机号已注册"),
	USER_PHONE_FORMAT_ERROR(60022, "手机号格式错误"),
	USER_PASSWORD_FORMAT_ERROR(60023, "密码格式错误"),
	USER_PASSWORD_ERROR(60024, "密码错误"),
	USER_ACCOUNT_ANOMALY(60025, "用户账户异常"),
	USER_ALREADY_FOLLOWED(60026, "用户已关注"),
	VERIFICATION_CODE_ERROR(60027, "验证码错误"),
	USERNAME_UPDATE_INTERVAL_NOT_EXCEEDED(60028, "用户名更新间隔未达到要求"),
	USERNAME_UPDATE_ERROR(60029, "用户名更改失败"),
	USER_GENDER_UPDATE_ERROR(60030, "性别更改失败"),
	USER_BIRTHDAY_UPDATE_ERROR(60031, "生日更改失败"),
	USER_LOCATION_UPDATE_ERROR(60032, "地区更改失败"),
	USER_BIO_UPDATE_ERROR(60033, "简介更改失败"),
	USER_GENDER_NOT_EXIST(60034, "性别不存在"),
	USER_BIO_TOO_LONG(60035, "简介过长"),
	USER_LOCATION_NOT_EXIST(60036, "地区不存在"),
	USER_BIRTHDAY_NOT_FUTURE(60037, "生日不能是未来日期"),
	USER_BIRTHDAY_NOT_NULL(60038, "生日不能为空"),
	USER_STATS_ERROR(60039, "用户统计信息错误"),
	
	
	// 帖子模块 61001 - 62000
	POST_CREATE_ERROR(61000, "帖子创建失败"),
	POST_UPDATE_ERROR(61001, "帖子更新失败"),
	POST_DELETE_ERROR(61002, "帖子删除失败"),
	POST_NOT_EXIST(61003, "帖子不存在"),
	POST_NOT_AUTHORIZED(61004, "帖子未授权"),
	POST_CATEGORY_NOT_EXIST(61005, "帖子分类不存在"),
	POST_CONTENT_SENSITIVE(61006, "内容包含敏感词"),
	POST_CONTENT_TOO_LONG(61007, "内容长度过长"),
	POST_CONTENT_TOO_SHORT(61008, "内容长度过短"),
	POST_CONTENT_NOT_NULL(61009, "内容不能为空"),
	POST_TITLE_SENSITIVE(61010, "标题包含敏感词"),
	POST_TITLE_TOO_LONG(61011, "标题长度过长"),
	POST_TITLE_TOO_SHORT(61012, "标题长度过短"),
	POST_TITLE_NOT_NULL(61013, "标题不能为空"),
	
	// 帖子评论
	POST_COMMENT_CREATE_ERROR(61501, "评论发送失败"),
	POST_COMMENT_NOT_EXIST(61502, "评论不存在"),
	POST_COMMENT_POST_NOT_EXIST(61503, "评论所属帖子不存在"),
	POST_COMMENT_USER_NOT_EXIST(61504, "评论所属用户不存在"),
	POST_COMMENT_CONTENT_SENSITIVE(61505, "评论内容包含敏感词"),
	POST_COMMENT_CONTENT_TOO_LONG(61506, "评论内容长度过长"),
	POST_COMMENT_CONTENT_NOT_NULL(61507, "评论内容不能为空"),
	
	// 帖子评论回复
	POST_COMMENT_REPLY_NOT_EXIST(61601, "评论回复不存在"),
	POST_COMMENT_REPLY_POST_NOT_EXIST(61605, "评论回复所属帖子不存在"),
	POST_COMMENT_REPLY_COMMENT_NOT_EXIST(61606, "评论回复所属评论不存在"),
	POST_COMMENT_REPLY_USER_NOT_EXIST(61607, "评论回复所属用户不存在"),
	POST_COMMENT_REPLY_CONTENT_SENSITIVE(61608, "评论回复内容包含敏感词"),
	POST_COMMENT_REPLY_CONTENT_TOO_LONG(61609, "评论回复内容长度过长"),
	POST_COMMENT_REPLY_CONTENT_NOT_NULL(61610, "评论回复内容不能为空"),
	
	
	// 分类模块 62001 - 63000
	CATEGORY_NOT_FOUND(62000, "分类不存在"),
	CATEGORY_EXIST(62001, "分类已存在"),
	CATEGORY_NOT_NULL(62003, "分类不能为空"),
	
	// 文件模块 63001 - 64000
	FILE_UPLOAD_ERROR(63000, "文件上传失败"),
	FILE_NOT_FOUND(63001, "文件不存在"),
	FILE_NOT_AUTHORIZED(63002, "文件未授权"),
	FILE_FORMAT_ERROR(63003, "文件格式错误"),
	FILE_SIZE_ERROR(63004, "文件大小错误"),
	FILE_NOT_NULL(63005, "文件不能为空"),
	FILE_DELETE_ERROR(63006, "文件删除失败"),
	
	
	/**
	 * 系统状态码 99000 - 99999
	 */
	SYSTEM_CONFIG_ERROR(99070, "系统配置错误"),
	SYSTEM_BUSY(99080, "系统繁忙"),
	SYSTEM_MAINTENANCE(99090, "系统维护中"),
	SYSTEM_ERROR(99999, "系统错误");
	
	private final Integer code;
	private final String message;
	
	ResultCode (Integer code, String message) {
		this.code = code;
		this.message = message;
	}
	
	
}
